Skip to contentSkip to conversation

Change in openvpn[master]: init: make some functions static

Openvpn-devel In review ordex (Code Review) 3 participants 6 messages Nov 3, 2025 – Nov 4, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1762214128000.I2b5429841bcd46376241890ace50b82a291b7400@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email

to review the following change.

Change subject: init: make some functions static
......................................................................

init: make some functions static

A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static.

Change-Id I2b5429841bcd46376241890ace50b82a291b7400

---
M src/openvpn/init.c
M src/openvpn/init.h

2 files changed, 26 insertions(+), 32 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/46/1346/1

src/openvpn/init.c +26 -26
index 1bdaf27..8d95d5c 100644
@@ -71,13 +71,13 @@
 
 static bool do_deferred_p2p_ncp(struct context *c);
 
-void
+static void
 context_clear(struct context *c)
 {
     CLEAR(*c);
 }
 
-void
+static void
 context_clear_1(struct context *c)
 {
     CLEAR(c->c1);
@@ -4430,32 +4430,9 @@
 }
 
 /*
- * Initialize a tunnel instance, handle pre and post-init
- * signal settings.
- */
-void
-init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
-{
-    pre_init_signal_catch();
-    init_instance(c, env, flags);
-    post_init_signal_catch();
-
-    /*
-     * This is done so that signals thrown during
-     * initialization can bring us back to
-     * a management hold.
-     */
-    if (IS_SIG(c))
-    {
-        remap_signal(c);
-        uninit_management_callback();
-    }
-}
-
-/*
  * Initialize a tunnel instance.
  */
-void
+static void
 init_instance(struct context *c, const struct env_set *env, const unsigned int flags)
 {
     const struct options *options = &c->options;
@@ -4745,6 +4722,29 @@
 }
 
 /*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
+{
+    pre_init_signal_catch();
+    init_instance(c, env, flags);
+    post_init_signal_catch();
+
+    /*
+     * This is done so that signals thrown during
+     * initialization can bring us back to
+     * a management hold.
+     */
+    if (IS_SIG(c))
+    {
+        remap_signal(c);
+        uninit_management_callback();
+    }
+}
+
+/*
  * Close a tunnel instance.
  */
 void
src/openvpn/init.h +0 -6
index e89615b..97318ec 100644
@@ -31,10 +31,6 @@
  */
 #define BASE_N_EVENTS 5
 
-void context_clear(struct context *c);
-
-void context_clear_1(struct context *c);
-
 void context_clear_2(struct context *c);
 
 void context_init_1(struct context *c);
@@ -64,8 +60,6 @@
 void init_instance_handle_signals(struct context *c, const struct env_set *env,
                                   const unsigned int flags);
 
-void init_instance(struct context *c, const struct env_set *env, const unsigned int flags);
-
 /**
  * Query for private key and auth-user-pass username/passwords.
  */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b5429841bcd46376241890ace50b82a291b7400
Gerrit-Change-Number: 1346
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: ordex, plaisthos.

flichtenheld has posted comments on this change by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email )

Change subject: init: make some functions static
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b5429841bcd46376241890ace50b82a291b7400
Gerrit-Change-Number: 1346
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Tue, 04 Nov 2025 10:36:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 init: make some functions static

In reply to a message not in the archive

From: Antonio Quartulli <[email protected]...>

A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static.

Change-Id I2b5429841bcd46376241890ace50b82a291b7400

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Frank Lichtenheld <[email protected]...>

src/openvpn/init.c +26 -26
index 1bdaf27..8d95d5c 100644
@@ -71,13 +71,13 @@
 
 static bool do_deferred_p2p_ncp(struct context *c);
 
-void
+static void
 context_clear(struct context *c)
 {
     CLEAR(*c);
 }
 
-void
+static void
 context_clear_1(struct context *c)
 {
     CLEAR(c->c1);
@@ -4430,32 +4430,9 @@
 }
 
 /*
- * Initialize a tunnel instance, handle pre and post-init
- * signal settings.
- */
-void
-init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
-{
-    pre_init_signal_catch();
-    init_instance(c, env, flags);
-    post_init_signal_catch();
-
-    /*
-     * This is done so that signals thrown during
-     * initialization can bring us back to
-     * a management hold.
-     */
-    if (IS_SIG(c))
-    {
-        remap_signal(c);
-        uninit_management_callback();
-    }
-}
-
-/*
  * Initialize a tunnel instance.
  */
-void
+static void
 init_instance(struct context *c, const struct env_set *env, const unsigned int flags)
 {
     const struct options *options = &c->options;
@@ -4745,6 +4722,29 @@
 }
 
 /*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
+{
+    pre_init_signal_catch();
+    init_instance(c, env, flags);
+    post_init_signal_catch();
+
+    /*
+     * This is done so that signals thrown during
+     * initialization can bring us back to
+     * a management hold.
+     */
+    if (IS_SIG(c))
+    {
+        remap_signal(c);
+        uninit_management_callback();
+    }
+}
+
+/*
  * Close a tunnel instance.
  */
 void
src/openvpn/init.h +0 -6
index e89615b..97318ec 100644
@@ -31,10 +31,6 @@
  */
 #define BASE_N_EVENTS 5
 
-void context_clear(struct context *c);
-
-void context_clear_1(struct context *c);
-
 void context_clear_2(struct context *c);
 
 void context_init_1(struct context *c);
@@ -64,8 +60,6 @@
 void init_instance_handle_signals(struct context *c, const struct env_set *env,
                                   const unsigned int flags);
 
-void init_instance(struct context *c, const struct env_set *env, const unsigned int flags);
-
 /**
  * Query for private key and auth-user-pass username/passwords.
  */
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: init: make some functions static

Fairly straightforward, a bunch of statics, one moved function so no prototype is needed anymore ("git show --color-moved"), and all BBs are happy...

Your patch has been applied to the master branch.

commit 8545a3db4e83d0294d823ad6489a3040de10984e

Author: Antonio Quartulli
Date:   Tue Nov 4 11:44:48 2025 +0100
     init: make some functions static

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Frank Lichtenheld <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg34193.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by flichtenheld

Change subject: init: make some functions static
......................................................................

init: make some functions static

A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static.

Change-Id I2b5429841bcd46376241890ace50b82a291b7400

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34193.html

---
M src/openvpn/init.c
M src/openvpn/init.h

2 files changed, 26 insertions(+), 32 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/46/1346/2

src/openvpn/init.c +26 -26
index 1bdaf27..8d95d5c 100644
@@ -71,13 +71,13 @@
 
 static bool do_deferred_p2p_ncp(struct context *c);
 
-void
+static void
 context_clear(struct context *c)
 {
     CLEAR(*c);
 }
 
-void
+static void
 context_clear_1(struct context *c)
 {
     CLEAR(c->c1);
@@ -4430,32 +4430,9 @@
 }
 
 /*
- * Initialize a tunnel instance, handle pre and post-init
- * signal settings.
- */
-void
-init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
-{
-    pre_init_signal_catch();
-    init_instance(c, env, flags);
-    post_init_signal_catch();
-
-    /*
-     * This is done so that signals thrown during
-     * initialization can bring us back to
-     * a management hold.
-     */
-    if (IS_SIG(c))
-    {
-        remap_signal(c);
-        uninit_management_callback();
-    }
-}
-
-/*
  * Initialize a tunnel instance.
  */
-void
+static void
 init_instance(struct context *c, const struct env_set *env, const unsigned int flags)
 {
     const struct options *options = &c->options;
@@ -4745,6 +4722,29 @@
 }
 
 /*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
+{
+    pre_init_signal_catch();
+    init_instance(c, env, flags);
+    post_init_signal_catch();
+
+    /*
+     * This is done so that signals thrown during
+     * initialization can bring us back to
+     * a management hold.
+     */
+    if (IS_SIG(c))
+    {
+        remap_signal(c);
+        uninit_management_callback();
+    }
+}
+
+/*
  * Close a tunnel instance.
  */
 void
src/openvpn/init.h +0 -6
index e89615b..97318ec 100644
@@ -31,10 +31,6 @@
  */
 #define BASE_N_EVENTS 5
 
-void context_clear(struct context *c);
-
-void context_clear_1(struct context *c);
-
 void context_clear_2(struct context *c);
 
 void context_init_1(struct context *c);
@@ -64,8 +60,6 @@
 void init_instance_handle_signals(struct context *c, const struct env_set *env,
                                   const unsigned int flags);
 
-void init_instance(struct context *c, const struct env_set *env, const unsigned int flags);
-
 /**
  * Query for private key and auth-user-pass username/passwords.
  */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b5429841bcd46376241890ace50b82a291b7400
Gerrit-Change-Number: 1346
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email )

Change subject: init: make some functions static
......................................................................

init: make some functions static

A bunch of functions are defined and used within init.c only. We can therefore drop their declaration in init.h and make them static.

Change-Id I2b5429841bcd46376241890ace50b82a291b7400

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1346
Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg34193.html

---
M src/openvpn/init.c
M src/openvpn/init.h

2 files changed, 26 insertions(+), 32 deletions(-)
src/openvpn/init.c +26 -26
index 1bdaf27..8d95d5c 100644
@@ -71,13 +71,13 @@
 
 static bool do_deferred_p2p_ncp(struct context *c);
 
-void
+static void
 context_clear(struct context *c)
 {
     CLEAR(*c);
 }
 
-void
+static void
 context_clear_1(struct context *c)
 {
     CLEAR(c->c1);
@@ -4430,32 +4430,9 @@
 }
 
 /*
- * Initialize a tunnel instance, handle pre and post-init
- * signal settings.
- */
-void
-init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
-{
-    pre_init_signal_catch();
-    init_instance(c, env, flags);
-    post_init_signal_catch();
-
-    /*
-     * This is done so that signals thrown during
-     * initialization can bring us back to
-     * a management hold.
-     */
-    if (IS_SIG(c))
-    {
-        remap_signal(c);
-        uninit_management_callback();
-    }
-}
-
-/*
  * Initialize a tunnel instance.
  */
-void
+static void
 init_instance(struct context *c, const struct env_set *env, const unsigned int flags)
 {
     const struct options *options = &c->options;
@@ -4745,6 +4722,29 @@
 }
 
 /*
+ * Initialize a tunnel instance, handle pre and post-init
+ * signal settings.
+ */
+void
+init_instance_handle_signals(struct context *c, const struct env_set *env, const unsigned int flags)
+{
+    pre_init_signal_catch();
+    init_instance(c, env, flags);
+    post_init_signal_catch();
+
+    /*
+     * This is done so that signals thrown during
+     * initialization can bring us back to
+     * a management hold.
+     */
+    if (IS_SIG(c))
+    {
+        remap_signal(c);
+        uninit_management_callback();
+    }
+}
+
+/*
  * Close a tunnel instance.
  */
 void
src/openvpn/init.h +0 -6
index e89615b..97318ec 100644
@@ -31,10 +31,6 @@
  */
 #define BASE_N_EVENTS 5
 
-void context_clear(struct context *c);
-
-void context_clear_1(struct context *c);
-
 void context_clear_2(struct context *c);
 
 void context_init_1(struct context *c);
@@ -64,8 +60,6 @@
 void init_instance_handle_signals(struct context *c, const struct env_set *env,
                                   const unsigned int flags);
 
-void init_instance(struct context *c, const struct env_set *env, const unsigned int flags);
-
 /**
  * Query for private key and auth-user-pass username/passwords.
  */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1346?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2b5429841bcd46376241890ace50b82a291b7400
Gerrit-Change-Number: 1346
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>